

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="老王">
  <meta name="keywords" content="">
  
    <meta name="description" content="书接上文，在计算出 ΔSNP-index 之后如何判断该位点是否存在 QTL？这里通过随机模拟实验来确定 ΔSNP-index 的置信区间（H0: 没有QTL）。  计算原理 模拟取样过程 双亲杂交（AA × BB）、自交后产生包含大量子代个体的分离群体（RIL 或 F2），随机抽取两组若干个体构成两个模拟 bulk pool。对于构成 bulk pool 的每一个个体可能的基因型以及概率是固定的">
<meta property="og:type" content="article">
<meta property="og:title" content="QTL-seq系列 | 如何计算置信区间">
<meta property="og:url" content="https://laowang2023.cn/2023/04/22/20230422-getQTLseqCI/index.html">
<meta property="og:site_name" content="请叫我老王">
<meta property="og:description" content="书接上文，在计算出 ΔSNP-index 之后如何判断该位点是否存在 QTL？这里通过随机模拟实验来确定 ΔSNP-index 的置信区间（H0: 没有QTL）。  计算原理 模拟取样过程 双亲杂交（AA × BB）、自交后产生包含大量子代个体的分离群体（RIL 或 F2），随机抽取两组若干个体构成两个模拟 bulk pool。对于构成 bulk pool 的每一个个体可能的基因型以及概率是固定的">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://laowang2023.cn/img/index_banner/20230422-QTLseqMethod.png">
<meta property="article:published_time" content="2023-04-22T13:32:37.000Z">
<meta property="article:modified_time" content="2025-01-24T09:28:26.386Z">
<meta property="article:author" content="老王">
<meta property="article:tag" content="R">
<meta property="article:tag" content="QTL-seq">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://laowang2023.cn/img/index_banner/20230422-QTLseqMethod.png">
  
  
  
  <title>QTL-seq系列 | 如何计算置信区间 - 请叫我老王</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/KaTeX/0.16.2/katex.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"laowang2023.cn","root":"/","version":"1.9.4","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"2gDQrSMhKFxALJaFFpTbgc23-gzGzoHsz","app_key":"NBsdUEdxwrnzaL1XcLReQM4N","server_url":"https://2gdqrsmh.lc-cn-n1-shared.com","path":"window.location.pathname","ignore_local":true}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  

  

  

  

  

  

  

  
    
  



  
<meta name="generator" content="Hexo 5.4.2"><link rel="alternate" href="/atom.xml" title="请叫我老王" type="application/atom+xml">
</head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>请叫我老王</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/atom.xml">
                <i class="iconfont icon-rss-fill"></i>
                <span>订阅</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/index_banner/qtlseq.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="QTL-seq系列 | 如何计算置信区间"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2023-04-22 21:32" pubdate>
          2023年4月22日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          4.8k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          41 分钟
        
      </span>
    

    
    
      
        <span id="leancloud-page-views-container" class="post-meta" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="leancloud-page-views"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">QTL-seq系列 | 如何计算置信区间</h1>
            
            
              <div class="markdown-body">
                
                <p><a href="../20230422-QTLseqMethod/">书接上文</a>，在计算出 ΔSNP-index 之后如何判断该位点是否存在 QTL？这里通过随机模拟实验来确定 ΔSNP-index 的置信区间（H0: 没有QTL）。</p>
<p><img src="./method.png" srcset="/img/loading.gif" lazyload alt="计算原理" title="计算原理"></p>
<h2 id="计算原理">计算原理</h2>
<h3 id="模拟取样过程">模拟取样过程</h3>
<p>双亲杂交（AA × BB）、自交后产生包含大量子代个体的分离群体（RIL 或 F<sub>2</sub>），随机抽取两组若干个体构成两个模拟 bulk pool。对于构成 bulk pool 的每一个个体可能的基因型以及概率是固定的，RIL 群体为 AA:BB = 0.5:0.5，而 F<sub>2</sub> 群体为 AA:AB:BB = 0.25:0.5:0.25，由此可以计算出给定子代数目的 bulk pool 中的等位基因频率 P(A) 和 P(B)。</p>
<h3 id="模拟计算-ΔSNP-index">模拟计算 ΔSNP-index</h3>
<p>前面计算出了 bulk pool 中的等位基因频率，那么在特定测序深度（N）下等位基因 A 出现的次数就相当于进行N次二项分布取样 <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo stretchy="false">(</mo><mi>A</mi><mo stretchy="false">)</mo><mo>=</mo><mi>X</mi><mo>∼</mo><mi>B</mi><mo stretchy="false">(</mo><mi>N</mi><mo separator="true">,</mo><mi>P</mi><mo stretchy="false">(</mo><mi>A</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">n(A) = X \sim B(N,P(A))</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">n</span><span class="mopen">(</span><span class="mord mathnormal">A</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.07847em;">X</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∼</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathnormal">A</span><span class="mclose">))</span></span></span></span>，进而可以得到 <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi><mi>N</mi><mi>P</mi><mtext> </mtext><mi>i</mi><mi>n</mi><mi>d</mi><mi>e</mi><mi>x</mi><mo>=</mo><mi>n</mi><mo stretchy="false">(</mo><mi>A</mi><mo stretchy="false">)</mo><mi mathvariant="normal">/</mi><mi>N</mi></mrow><annotation encoding="application/x-tex">SNP\ index = n(A)/{N}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">SNP</span><span class="mspace"> </span><span class="mord mathnormal">in</span><span class="mord mathnormal">d</span><span class="mord mathnormal">e</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">n</span><span class="mopen">(</span><span class="mord mathnormal">A</span><span class="mclose">)</span><span class="mord">/</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">N</span></span></span></span></span>，两个 bulk pool 的 SNP index 相减得到 ΔSNP-index。</p>
<h3 id="计算零假设下的-ΔSNP-index-分布">计算零假设下的 ΔSNP-index 分布</h3>
<p>将以上过程重复若干次（10000次）可以得到在零假设下的 ΔSNP-index 的分布，取其上分位数和下分位数可以得到对应置信区间（如 95% 置信区间取上 0.025 分位数和下 0.025 分位数）。</p>
<h2 id="代码实现">代码实现</h2>
<h3 id="模拟计算-ΔSNP-index-置信区间">模拟计算 ΔSNP-index 置信区间</h3>
<p>这里使用 R 语言实现上述过程。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><code class="hljs R"><span class="hljs-comment"># 加载R包</span><br>library<span class="hljs-punctuation">(</span>tidyverse<span class="hljs-punctuation">)</span><br>library<span class="hljs-punctuation">(</span>cowplot<span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 定义基本信息</span><br>popType <span class="hljs-operator">&lt;-</span> <span class="hljs-string">&quot;RIL&quot;</span>    <span class="hljs-comment"># 群体类型，RIL或F2</span><br>bulkSizeH <span class="hljs-operator">&lt;-</span> 30     <span class="hljs-comment"># 高值表型bulk pool个体数</span><br>bulkSizeL <span class="hljs-operator">&lt;-</span> 30     <span class="hljs-comment"># 低值表型bulk pool个体数</span><br>minDepth <span class="hljs-operator">&lt;-</span> 5       <span class="hljs-comment"># 最低覆盖深度</span><br>maxDepth <span class="hljs-operator">&lt;-</span> 150     <span class="hljs-comment"># 最高覆盖深度</span><br>repN <span class="hljs-operator">&lt;-</span> 10000       <span class="hljs-comment"># 模拟实验重复次数</span><br><span class="hljs-comment"># 定义数据框，每一行代表两个bulk pool的不同覆盖深度</span><br>dltIndex_CI <span class="hljs-operator">&lt;-</span> tibble<span class="hljs-punctuation">(</span>HB.DP <span class="hljs-operator">=</span> <span class="hljs-built_in">rep</span><span class="hljs-punctuation">(</span>minDepth<span class="hljs-operator">:</span>maxDepth<span class="hljs-punctuation">,</span> times <span class="hljs-operator">=</span> maxDepth<span class="hljs-operator">-</span>minDepth<span class="hljs-operator">+</span><span class="hljs-number">1</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                      LB.DP <span class="hljs-operator">=</span> <span class="hljs-built_in">rep</span><span class="hljs-punctuation">(</span>minDepth<span class="hljs-operator">:</span>maxDepth<span class="hljs-punctuation">,</span> each <span class="hljs-operator">=</span> maxDepth<span class="hljs-operator">-</span>minDepth<span class="hljs-operator">+</span><span class="hljs-number">1</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>                      CI95upper <span class="hljs-operator">=</span> <span class="hljs-literal">NA</span><span class="hljs-punctuation">,</span> CI95lower <span class="hljs-operator">=</span> <span class="hljs-literal">NA</span><span class="hljs-punctuation">,</span> CI99upper <span class="hljs-operator">=</span> <span class="hljs-literal">NA</span><span class="hljs-punctuation">,</span> CI99lower <span class="hljs-operator">=</span> <span class="hljs-literal">NA</span><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 定义一个进度条，用于显示计算进度</span><br>width <span class="hljs-operator">&lt;-</span> options<span class="hljs-punctuation">(</span><span class="hljs-punctuation">)</span><span class="hljs-operator">$</span>width<br>pb <span class="hljs-operator">&lt;-</span> progress<span class="hljs-operator">::</span>progress_bar<span class="hljs-operator">$</span>new<span class="hljs-punctuation">(</span><br>  format <span class="hljs-operator">=</span> <span class="hljs-string">&#x27;Progress [:bar] :percent eta: :eta&#x27;</span><span class="hljs-punctuation">,</span><br>  total <span class="hljs-operator">=</span> nrow<span class="hljs-punctuation">(</span>dltIndex_CI<span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> clear <span class="hljs-operator">=</span> <span class="hljs-literal">FALSE</span><span class="hljs-punctuation">,</span> width <span class="hljs-operator">=</span> width<br><span class="hljs-punctuation">)</span><br><span class="hljs-comment"># 对不同覆盖深度循环计算置信区间，即循环dltIndex_CI的每一行</span><br><span class="hljs-keyword">for</span> <span class="hljs-punctuation">(</span>i <span class="hljs-keyword">in</span> <span class="hljs-number">1</span><span class="hljs-operator">:</span>nrow<span class="hljs-punctuation">(</span>dltIndex_CI<span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-punctuation">&#123;</span><br>  depthH <span class="hljs-operator">&lt;-</span> dltIndex_CI<span class="hljs-punctuation">[</span>i<span class="hljs-punctuation">,</span> <span class="hljs-number">1</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">[[</span><span class="hljs-number">1</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">]</span><br>  depthL <span class="hljs-operator">&lt;-</span> dltIndex_CI<span class="hljs-punctuation">[</span>i<span class="hljs-punctuation">,</span> <span class="hljs-number">2</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">[[</span><span class="hljs-number">1</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">]</span><br>  <span class="hljs-comment"># 模拟计算high bulk pool和low bulk pool的等位基因频率，重复repN次</span><br>  <span class="hljs-keyword">if</span> <span class="hljs-punctuation">(</span>popType <span class="hljs-operator">==</span> <span class="hljs-string">&quot;RIL&quot;</span><span class="hljs-punctuation">)</span> <span class="hljs-punctuation">&#123;</span><br>    PH <span class="hljs-operator">&lt;-</span> rbinom<span class="hljs-punctuation">(</span>repN<span class="hljs-punctuation">,</span> bulkSizeH<span class="hljs-punctuation">,</span> <span class="hljs-number">0.5</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">/</span> bulkSizeH<br>    PL <span class="hljs-operator">&lt;-</span> rbinom<span class="hljs-punctuation">(</span>repN<span class="hljs-punctuation">,</span> bulkSizeL<span class="hljs-punctuation">,</span> <span class="hljs-number">0.5</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">/</span> bulkSizeL<br>  <span class="hljs-punctuation">&#125;</span> <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> <span class="hljs-punctuation">(</span>popType <span class="hljs-operator">==</span> <span class="hljs-string">&quot;F2&quot;</span><span class="hljs-punctuation">)</span> <span class="hljs-punctuation">&#123;</span><br>    PH <span class="hljs-operator">&lt;-</span> apply<span class="hljs-punctuation">(</span>rmultinom<span class="hljs-punctuation">(</span>repN<span class="hljs-punctuation">,</span> bulkSizeH<span class="hljs-punctuation">,</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">1</span><span class="hljs-punctuation">,</span> <span class="hljs-number">2</span><span class="hljs-punctuation">,</span> <span class="hljs-number">1</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">*</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">1</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0.5</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">/</span> bulkSizeH<span class="hljs-punctuation">,</span> <span class="hljs-number">2</span><span class="hljs-punctuation">,</span> <span class="hljs-built_in">sum</span><span class="hljs-punctuation">)</span><br>    PL <span class="hljs-operator">&lt;-</span> apply<span class="hljs-punctuation">(</span>rmultinom<span class="hljs-punctuation">(</span>repN<span class="hljs-punctuation">,</span> bulkSizeL<span class="hljs-punctuation">,</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">1</span><span class="hljs-punctuation">,</span> <span class="hljs-number">2</span><span class="hljs-punctuation">,</span> <span class="hljs-number">1</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">*</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">1</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0.5</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">/</span> bulkSizeL<span class="hljs-punctuation">,</span> <span class="hljs-number">2</span><span class="hljs-punctuation">,</span> <span class="hljs-built_in">sum</span><span class="hljs-punctuation">)</span><br>  <span class="hljs-punctuation">&#125;</span><br>  <span class="hljs-comment"># 模拟计算两个bulk pool的ΔSNP-index，重复repN次</span><br>  indexH <span class="hljs-operator">&lt;-</span> rbinom<span class="hljs-punctuation">(</span>repN<span class="hljs-punctuation">,</span> depthH<span class="hljs-punctuation">,</span> PH<span class="hljs-punctuation">)</span> <span class="hljs-operator">/</span> depthH<br>  indexL <span class="hljs-operator">&lt;-</span> rbinom<span class="hljs-punctuation">(</span>repN<span class="hljs-punctuation">,</span> depthL<span class="hljs-punctuation">,</span> PL<span class="hljs-punctuation">)</span> <span class="hljs-operator">/</span> depthL<br>  dltIndex <span class="hljs-operator">&lt;-</span> indexH <span class="hljs-operator">-</span> indexL<br>  <span class="hljs-comment"># 取上分位数和下分位数作为置信区间</span><br>  dltIndex_CI<span class="hljs-punctuation">[</span>i<span class="hljs-punctuation">,</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-string">&quot;CI95upper&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;CI95lower&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;CI99upper&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;CI99lower&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">]</span> <span class="hljs-operator">&lt;-</span> t<span class="hljs-punctuation">(</span><br>    <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span>quantile<span class="hljs-punctuation">(</span>dltIndex<span class="hljs-punctuation">,</span> <span class="hljs-number">0.975</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> quantile<span class="hljs-punctuation">(</span>dltIndex<span class="hljs-punctuation">,</span> <span class="hljs-number">0.025</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>      quantile<span class="hljs-punctuation">(</span>dltIndex<span class="hljs-punctuation">,</span> <span class="hljs-number">0.995</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> quantile<span class="hljs-punctuation">(</span>dltIndex<span class="hljs-punctuation">,</span> <span class="hljs-number">0.005</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>  <span class="hljs-punctuation">)</span><br>  <span class="hljs-comment"># 打印进度条</span><br>  pb<span class="hljs-operator">$</span>tick<span class="hljs-punctuation">(</span><span class="hljs-punctuation">)</span><br><span class="hljs-punctuation">&#125;</span><br><span class="hljs-comment"># 保存结果，导出指定群体类型、bulk pool大小下不同覆盖深度的置信区间</span><br>save<span class="hljs-punctuation">(</span>dltIndex_CI<span class="hljs-punctuation">,</span> <br>     file <span class="hljs-operator">=</span> paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;QTLseqCI&quot;</span><span class="hljs-punctuation">,</span> <br>                  paste<span class="hljs-punctuation">(</span>paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indH&quot;</span><span class="hljs-punctuation">,</span> bulkSizeH<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                        paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indL&quot;</span><span class="hljs-punctuation">,</span> bulkSizeL<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                        popType<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                  paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Depth&quot;</span><span class="hljs-punctuation">,</span> minDepth<span class="hljs-punctuation">,</span> maxDepth<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                  paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Rep&quot;</span><span class="hljs-punctuation">,</span> repN<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>                  <span class="hljs-string">&quot;RData&quot;</span><span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;.&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<h3 id="ΔSNP-index-置信区间可视化">ΔSNP-index 置信区间可视化</h3>
<p>由此我们得到了特定群体类型、特定样本量大小下，不同测序深度位点的 ΔSNP-index 的 95% 和 99% 的置信区间，把结果导出保存为 RData 文件，方便下次使用而不用重复计算。ΔSNP-index 的置信区间和覆盖深度的关系是怎样的呢？我们通过将上面结果可视化，将横坐标、纵坐标分别表示为 high bulk pool、low bulk pool 的位点覆盖深度，将 ΔSNP-index 的置信区间上限和下限值表示为不同颜色。由下面绘图结果可以看出，当提高位点覆盖深度时，ΔSNP-index 的置信区间范围将会缩小，相反置信区间范围会增大。按照同样的思路我们也可以探究 ΔSNP-index 置信区间和群体类型、每个 pool 取样多少的关系。</p>
<figure class="highlight r"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><code class="hljs R"><span class="hljs-comment"># 将置信区间和覆盖深度的关系可视化</span><br>df <span class="hljs-operator">&lt;-</span> gather<span class="hljs-punctuation">(</span>dltIndex_CI<span class="hljs-punctuation">,</span> type<span class="hljs-punctuation">,</span> CI<span class="hljs-punctuation">,</span> <span class="hljs-operator">-</span>HB.DP<span class="hljs-punctuation">,</span> <span class="hljs-operator">-</span>LB.DP<span class="hljs-punctuation">)</span> <span class="hljs-operator">%&gt;%</span> <br>  mutate<span class="hljs-punctuation">(</span>level <span class="hljs-operator">=</span> if_else<span class="hljs-punctuation">(</span>str_detect<span class="hljs-punctuation">(</span>type<span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;95&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;95 CI&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;99 CI&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>         direction <span class="hljs-operator">=</span> if_else<span class="hljs-punctuation">(</span>str_detect<span class="hljs-punctuation">(</span>type<span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;upper&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;Upper CI&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;Lower CI&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>df<span class="hljs-operator">$</span>direction <span class="hljs-operator">&lt;-</span> factor<span class="hljs-punctuation">(</span>df<span class="hljs-operator">$</span>direction<span class="hljs-punctuation">,</span> levels <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Upper CI&quot;</span><span class="hljs-punctuation">,</span> <span class="hljs-string">&quot;Lower CI&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>P_CI <span class="hljs-operator">&lt;-</span> ggplot<span class="hljs-punctuation">(</span>df<span class="hljs-punctuation">,</span> aes<span class="hljs-punctuation">(</span>x <span class="hljs-operator">=</span> HB.DP<span class="hljs-punctuation">,</span> y <span class="hljs-operator">=</span> LB.DP<span class="hljs-punctuation">,</span> fill <span class="hljs-operator">=</span> CI<span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span> <br>  geom_tile<span class="hljs-punctuation">(</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span> <br>  scale_x_continuous<span class="hljs-punctuation">(</span>expand <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">0</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span><br>  scale_y_continuous<span class="hljs-punctuation">(</span>expand <span class="hljs-operator">=</span> <span class="hljs-built_in">c</span><span class="hljs-punctuation">(</span><span class="hljs-number">0</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span><br>  scale_fill_distiller<span class="hljs-punctuation">(</span>palette <span class="hljs-operator">=</span> <span class="hljs-string">&quot;RdBu&quot;</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span><br>  labs<span class="hljs-punctuation">(</span>title <span class="hljs-operator">=</span> paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;CI&quot;</span><span class="hljs-punctuation">,</span> <br>                     paste<span class="hljs-punctuation">(</span>paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indH&quot;</span><span class="hljs-punctuation">,</span> bulkSizeH<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                           paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indL&quot;</span><span class="hljs-punctuation">,</span> bulkSizeL<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                           popType<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                     paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Depth&quot;</span><span class="hljs-punctuation">,</span> minDepth<span class="hljs-punctuation">,</span> maxDepth<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                     paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Rep&quot;</span><span class="hljs-punctuation">,</span> repN<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;.&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>       fill <span class="hljs-operator">=</span> <span class="hljs-literal">NULL</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span><br>  facet_grid<span class="hljs-punctuation">(</span>direction <span class="hljs-operator">~</span> level<span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span><br>  theme_half_open<span class="hljs-punctuation">(</span><span class="hljs-punctuation">)</span> <span class="hljs-operator">+</span><br>  theme<span class="hljs-punctuation">(</span>strip.background <span class="hljs-operator">=</span> element_rect<span class="hljs-punctuation">(</span>fill <span class="hljs-operator">=</span> <span class="hljs-string">&quot;#90EE90&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>        plot.title <span class="hljs-operator">=</span> element_text<span class="hljs-punctuation">(</span>hjust <span class="hljs-operator">=</span> <span class="hljs-number">0.5</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">)</span><br>ggsave<span class="hljs-punctuation">(</span>P_CI<span class="hljs-punctuation">,</span> filename <span class="hljs-operator">=</span> paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;QTLseqCI&quot;</span><span class="hljs-punctuation">,</span> <br>                              paste<span class="hljs-punctuation">(</span>paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indH&quot;</span><span class="hljs-punctuation">,</span> bulkSizeH<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                                    paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indL&quot;</span><span class="hljs-punctuation">,</span> bulkSizeL<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                                    popType<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                              paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Depth&quot;</span><span class="hljs-punctuation">,</span> minDepth<span class="hljs-punctuation">,</span> maxDepth<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                              paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Rep&quot;</span><span class="hljs-punctuation">,</span> repN<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>                              <span class="hljs-string">&quot;pdf&quot;</span><span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;.&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>       width <span class="hljs-operator">=</span> <span class="hljs-number">6.5</span><span class="hljs-punctuation">,</span> height <span class="hljs-operator">=</span> <span class="hljs-number">6</span><span class="hljs-punctuation">)</span><br>ggsave<span class="hljs-punctuation">(</span>P_CI<span class="hljs-punctuation">,</span> filename <span class="hljs-operator">=</span> paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;QTLseqCI&quot;</span><span class="hljs-punctuation">,</span> <br>                              paste<span class="hljs-punctuation">(</span>paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indH&quot;</span><span class="hljs-punctuation">,</span> bulkSizeH<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                                    paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;indL&quot;</span><span class="hljs-punctuation">,</span> bulkSizeL<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                                    popType<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                              paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Depth&quot;</span><span class="hljs-punctuation">,</span> minDepth<span class="hljs-punctuation">,</span> maxDepth<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span> <br>                              paste<span class="hljs-punctuation">(</span><span class="hljs-string">&quot;Rep&quot;</span><span class="hljs-punctuation">,</span> repN<span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;_&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>                              <span class="hljs-string">&quot;png&quot;</span><span class="hljs-punctuation">,</span> sep <span class="hljs-operator">=</span> <span class="hljs-string">&quot;.&quot;</span><span class="hljs-punctuation">)</span><span class="hljs-punctuation">,</span><br>       width <span class="hljs-operator">=</span> <span class="hljs-number">6.5</span><span class="hljs-punctuation">,</span> height <span class="hljs-operator">=</span> <span class="hljs-number">6</span><span class="hljs-punctuation">,</span> units <span class="hljs-operator">=</span> <span class="hljs-string">&quot;in&quot;</span><span class="hljs-punctuation">,</span> dpi <span class="hljs-operator">=</span> <span class="hljs-number">500</span><span class="hljs-punctuation">)</span><br></code></pre></td></tr></table></figure>
<p><img src="./QTLseqCI.png" srcset="/img/loading.gif" lazyload alt="置信区间和覆盖深度的关系" title="置信区间和覆盖深度的关系"></p>
<hr>
<p class="note note-primary">参考文献</p>
<p><a target="_blank" rel="noopener" href="https://onlinelibrary.wiley.com/doi/10.1111/tpj.12105">Takagi H, Abe A, Yoshida K, et al. QTL-seq: rapid mapping of quantitative trait loci in rice by whole genome resequencing of DNA from two bulked populations. Plant J. 2013;74(1):174-183. doi:10.1111/tpj.12105</a></p>
<p><img src="https://images.pexels.com/photos/1322129/pexels-photo-1322129.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=1260&amp;h=750&amp;dpr=1" srcset="/img/loading.gif" lazyload alt="图片与主题无关" title="图片与主题无关"></p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" class="category-chain-item">技术分享</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/R/">#R</a>
      
        <a href="/tags/QTL-seq/">#QTL-seq</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>QTL-seq系列 | 如何计算置信区间</div>
      <div>https://laowang2023.cn/2023/04/22/20230422-getQTLseqCI/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>老王</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2023年4月22日</div>
        </div>
      
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2023/04/24/20230424-FirstYearAnniversary/" title="搞对象一周年纪念日">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">搞对象一周年纪念日</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2023/04/22/20230422-QTLseqMethod/" title="QTL-seq系列 | QTL-seq原理">
                        <span class="hidden-mobile">QTL-seq系列 | QTL-seq原理</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  
  
    <article id="comments" lazyload>
      
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"81Ynz10f9eqlTLw0V6ue4tBu-gzGzoHsz","appKey":"4Mxe0RlrV6wJ0n9C6ZDpYI6O","path":"window.location.pathname","placeholder":"你是不是想说点什么","avatar":"identicon","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":true,"serverURLs":"https://81ynz10f.lc-cn-n1-shared.com","emojiCDN":null,"emojiMaps":null,"enableQQ":true},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  


  
  








    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="leancloud-site-pv-container" style="display: none">
        总访问量 
        <span id="leancloud-site-pv"></span>
         次
      </span>
    
    
      <span id="leancloud-site-uv-container" style="display: none">
        总访客数 
        <span id="leancloud-site-uv"></span>
         人
      </span>
    
    

  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script defer src="/js/leancloud.js" ></script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
